<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for sample.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file sample.php</h1>
<p>Documentation is available at <a href="../WapBilling/_libsPub---WapBilling---sample.php.html">sample.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php&nbsp;</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;WapBilling</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Oliver&nbsp;Leisalu</span></div></li>
<li><div class="src-line"><a name="a5"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;DO&nbsp;BEFORE&nbsp;USING</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;1)&nbsp;Add&nbsp;config&nbsp;file&nbsp;to&nbsp;your&nbsp;config&nbsp;dir.&nbsp;(see&nbsp;sample-conf.php,&nbsp;rename&nbsp;it&nbsp;to&nbsp;wapBilling.conf.php)</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;2)&nbsp;Start&nbsp;Dom&nbsp;framework&nbsp;before&nbsp;using&nbsp;any&nbsp;WapBilling&nbsp;features.</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;3)&nbsp;Connect&nbsp;to&nbsp;database&nbsp;before&nbsp;making&nbsp;any&nbsp;payments.&nbsp;(For&nbsp;logging)</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;4)&nbsp;Call&nbsp;WapBillingLog::getTable()-&gt;update();&nbsp;This&nbsp;will&nbsp;create&nbsp;logging&nbsp;table!</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;Simulating:&nbsp;http://site.com/?msisdn=SAMPLE_NUM&amp;resolveTo=OPERATOR</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a15"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'pank'</span><span class="src-sym">]&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a17"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$payment&nbsp;</span>=&nbsp;<span class="src-id"><a href="../WapBilling/WapBilling.html">WapBilling</a></span><span class="src-sym">::</span><a href="../WapBilling/WapBilling.html#methodpay">pay</a><span class="src-sym">(&nbsp;</span><span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'price'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-str">'Test&nbsp;payment'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'some&nbsp;id'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a19"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(&nbsp;</span><span class="src-var">$payment&nbsp;</span>==&nbsp;<span class="src-num">0&nbsp;</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-str">'Paid&nbsp;&lt;b&gt;'</span>.<span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'price'</span><span class="src-sym">]</span>.<span class="src-str">'&lt;/b&gt;&nbsp;EEK&nbsp;successfully!&lt;br&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-str">'Payment&nbsp;failed!&nbsp;Error:&nbsp;&lt;b&gt;'</span>.<span class="src-var">$payment</span>.<span class="src-str">'&lt;/b&gt;.&nbsp;Error&nbsp;message:&nbsp;&lt;b&gt;'</span>.<span class="src-id"><a href="../WapBilling/WapBilling.html">WapBilling</a></span><span class="src-sym">::</span><a href="../WapBilling/WapBilling.html#methodgetLastError">getLastError</a><span class="src-sym">(</span><span class="src-sym">)</span>.<span class="src-str">'&lt;/b&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a26"></a>echo&nbsp;<span class="src-str">'Operator:&nbsp;'</span>.<span class="src-id"><a href="../WapBilling/WapBilling.html">WapBilling</a></span><span class="src-sym">::</span><a href="../WapBilling/WapBilling.html#methodgetOperator">getOperator</a><span class="src-sym">(</span><span class="src-sym">)</span>.<span class="src-str">'&nbsp;PhoneNr:&nbsp;'</span>.<span class="src-id"><a href="../WapBilling/WapBilling.html">WapBilling</a></span><span class="src-sym">::</span><a href="../WapBilling/WapBilling.html#methodgetPhoneNr">getPhoneNr</a><span class="src-sym">(</span><span class="src-sym">)</span>.<span class="src-str">'&lt;br&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-php">?&gt;</span></div></li>
<li><div class="src-line"><a name="a28"></a>&lt;form&nbsp;name=&quot;form&quot;&nbsp;action=&quot;&quot;&nbsp;method=&quot;post&quot;&gt;</div></li>
<li><div class="src-line"><a name="a29"></a>&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;text&quot;&nbsp;value=&quot;0.01&quot;&nbsp;name=&quot;price&quot;&gt;</div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;submit&quot;&nbsp;name=&quot;pank&quot;&nbsp;value=&quot;Maksa&quot;&gt;</div></li>
<li><div class="src-line"><a name="a31"></a>&lt;/form&gt;</div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 24 Sep 2010 21:15:11 +0000 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</body>
</html>